<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 申请管理控制器
 */
class Apply extends AdminBase
{
    
    /**
     * 查看申请
     */
    public function applyList()
    {
        
        $this->assign('list', $this->logicApplylist->getApplylistList());
        
        return $this->fetch('apply_list');
    }
    
    /**
     * 提出申请
     */
    public function applyAdd()
    {
        
        IS_POST && $this->jump($this->logicApplylist->applyEdit($this->param));
        
        return $this->fetch('apply_edit');
    }
    
    /**
     * 修改申请
     */
    public function applyEdit()
    {
        
        IS_POST && $this->jump($this->logicApplylist->applyEdit($this->param));
        
        $info = $this->logicApplylist->getApplylistInfo(['id' => $this->param['id']]);
        
        $this->assign('info', $info);
        
        return $this->fetch('apply_edit');
    }
    
    /**
     * 删除申请
     */
    public function applyDel($id = 0)
    {
        
        $this->jump($this->logicApplylist->applyDel(['id' => $id]));
    }
}
